<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <!-- ArcGIS API for JavaScript本地部署地址 -->
    <link rel="stylesheet" hrel="http://localhost/4.17/esri/css/main.css" />
    <script src="http://localhost/4.17/dojo/dojo.js"></script>
    <script>
        require([
            "esri/Map",
            "esri/Basemap",
            "esri/views/MapView",
            "esri/views/SceneView",
            "esri/geometry/Extent",
            "esri/geometry/SpatialReference",
            "esri/geometry/Point",
            "esri/geometry/Polyline",
            "esri/geometry/Polygon",
            "esri/Graphic",
            "esri/Color",
            "esri/views/layers/LayerView",
            "esri/layers/TileLayer",
            "esri/layers/MapImageLayer",
            "esri/layers/FeatureLayer",
            "esri/layers/GraphicsLayer",
            "esri/symbols/SimpleMarkerSymbol",
            "esri/symbols/SimpleFillSymbol",
            "esri/symbols/SimpleLineSymbol",
            "esri/tasks/support/BufferParameters",
            "esri/tasks/support/GeometryService",
            "esri/core/urlUtils",
            "esri/tasks/QueryTask",
            "esri/tasks/support/Query",
            "esri/tasks/IdentifyTask",
            "dojo/dom",
            "dojo/on",
            "dojo/domReady!"
        ], function(
            Map,
            Basemap,
            MapView,
            SceneView,
            Extent,
            SpatialReference,
            Point,
            Polyline,
            Polygon,
            Graphic,
            Color,
            LayerView,
            TileLayer,
            MapImageLayer,
            FeatureLayer,
            GraphicsLayer,
            SimpleMarkerSymbol,
            SimpleFillSymbol,
            SimpleLineSymbol,
            BufferParameters,
            GeometryService,
            urlUtils,
            QueryTask,
            Query,
            IdentifyTask,
            dom,
            on) {
            //创建一个地图Map实例
            var basemap = new Basemap({
                baseLayers: [
                    new MapImageLayer({
                        url: "http://www.fqghj.net:8022/arcgis/rest/services/CXGHBZ/YDGHPH/MapServer"
                    })
                ],
                title: "basemap",
                id: "basemap"
            });

            var layer = new MapImageLayer({
                url: "http://www.fqghj.net:8022/arcgis/rest/services/DG/CZKFBJ0614/MapServer"
            });
            var map = new Map({ //属性：allLayers、ground、layers
                basemap: basemap,
                layers: [layer]
            });
            //创建一个MapView实例（用于2D查看）并引用该地图实例
            //为了使地图在DOM中对用户可见，必须创建一个MapView并至少引用两个对象：一个Map实例和一个DOM元素。分别在map和container属性中设置。
            var view = new MapView({
                container: "viewDiv",
                map: map,
                zoom: 4,
                center: [55, 65] // longitude, latitude
            });

        });
    </script>
</head>

<body>
    <div id="viewDiv"></div>
</body>

</html>